package com.he.DesignPatterns.factory.SimpleFactory;

/**
 * @description: TODO
 * @Author: HCL
 * @Date: 2024/8/26 9:29
 */
public class CoffeeStore {

    public Coffee selectCoffee(String type) {
//        CoffeeFactory coffeeFactory = new CoffeeFactory();
//        Coffee coffee = coffeeFactory.createCoffee(type); //调用工厂方法生产咖啡

        Coffee coffee = CoffeeFactory.createCoffee(type);
        coffee.addMilk();
        coffee.addSugar();
        return coffee;
    }
}
